import requests,re
url01='https://passport.cnblogs.com/user/signin'
headers01={
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0',
'Accept': 'application/json, text/javascript, */*; q=0.01',
'Accept-Language': 'zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/json; charset=utf-8',
'X-Requested-With': 'XMLHttpRequest',
'Content-Length': '385',
'Cookie': '_ga=GA1.2.1578020020.1503646785; SERVERID=dcc5cb8c464da84cc9928c22dd5884f8|1504603312|1504594354; _gid=GA1.2.1933564343.1504575384',
'Connection': 'keep-alive',
}
password01={"input1":"cusdeWD+keed8BfO5+umxhkN0tMGKhB00sEfCVYLJonE4qwXiA/usZGA6Ou4dUhdZl9EDo82AEN0hNgZCFAxsCxEk+RaVGGyifm/L+B0+9uaiRgeKix66BOypSo+KmW9ZCrjpS0J1b2ulRZhu1hHBk1kcAURLpv6N/RNJpvFCeY=",
            "input2":"XQ8r6L9nX1TWKlUP36fcrp6YsbL2TkzMQo455gXPICwDMMVFh21MqfG6y8N52aDvZ0Z+MzkxaWPobH3/QyGBHxVY59+8GBzduTGc4YoNJCz4WK9BHZU/ZZEbSMER2UZqTi0UTGX8sfhaW/Y/QwvBKErbnKP42d5Nxmy/7Bv21Ds=",
            "remember":'true'}
s=requests.session()
response=s.post(url01,headers=headers01,json=password01,verify=False)
print(response.json())

url02='https://i.cnblogs.com/EditPosts.aspx?opt=1'
headers02={
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language': 'zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3',
'Accept-Encoding': 'gzip, deflate, br',
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': '9141',
'Cookie': '_ga=GA1.2.1578020020.1503646785; _gid=GA1.2.1933564343.1504575384; SERVERID=5600344ccf6bd2d4bb4775a2baf862da|1504603913|1504594354; .CNBlogsCookie=7D9498BBED41248E45AE132CD48499DF1DAE0B01B7ED83CAC223A3456F632C9395E56F65A139DF46289863C7728B4C6FD543E2516077590B86E08166E9AC32BF2F6087F49E8EC03AA6B696011D01062067407183AD15A844056E95916AB44AB0399122BC; .Cnblogs.AspNetCore.Cookies=CfDJ8BMYgQprmCpNu7uffp6PrYZHt1Dxqwjm-iIW4sLsQVTC92rdgy0cXBpyr_cqNvVic8zKTiMnyIpYn_TF3bO-or2NrC6CX7ENakBynJjy36x9GvWX3Q-9QR7AgCqOATn2CuQIH-GmlaEmG4PmMNFx0tZXeiWDN6tNErCi1MNojX8VLy09Zw0oU3gnuBiAismcqgqiGjqwOpqfyKpZ3X5oGupPXN3CMoFH96qBkf5FeSc2cPj20efuz8-KrmRoUCpW9VoafRp5k_GRSxhlL2Y9oskMzSk53Zs4ol0zuU7N5TsphsGaAH_S7EPV10zpdJAA_g',
'Connection': 'keep-alive',
'Upgrade-Insecure-Requests': '1',
}
password02={
    '__VIEWSTATE': '',
    '__VIEWSTATEGENERATOR': 'FE27D343',
    'Editor$Edit$txbTitle': 'hehe01',
    'Editor$Edit$EditorBody': '<p>测试02</p>',
    'Editor$Edit$Advanced$ckbPublished': 'on',
    'Editor$Edit$Advanced$chkDisplayHomePage': 'on',
    'Editor$Edit$Advanced$chkComments': 'on',
    'Editor$Edit$Advanced$chkMainSyndication': 'on',
    'Editor$Edit$lkbPost': '发布',
}
response02=s.post(url02,data=password02,verify=False)
print(response02.text,response02.status_code)

postid=re.findall(r'postid=(.+?)&',response02.url)
print(postid[0])
url03='https://i.cnblogs.com/post/delete'
password03={
    'postId':postid[0]
}
response03=s.post(url03,json=password03,verify=False)
print(response03.json())
print(response03.text)
print(response03.cookies['SERVERID'])